import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import Root from '@/views/Home.vue'
import Editor from '@/views/Editor.vue'
import Article from '@/views/Article.vue'
import Manage from '@/views/Manage.vue'

const routes = [
  { path: '/', component: Root },
  { path: '/home', component: Root },
  { path: '/login', component: Login },
  { path: '/editor', component: Editor },
  { path: '/editor/:id', component: Editor, props: true },
  { path: '/article/:id', component: Article, props: true },
  { path: '/manage', component: Manage }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
